/**
 * 自定义全局样式
 */

/* 全局覆盖样式 */
html {
  --scroll-behavior: smooth !important;
  scroll-behavior: smooth !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans",
    "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--vp-c-text-1);
}

/* 改善链接样式 */
a {
  font-weight: 500;
  color: var(--vp-c-brand);
  text-decoration-style: dotted;
  transition: color 0.25s;
}

a:hover {
  color: var(--vp-c-brand-dark);
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

tr {
  border-top: 1px solid var(--vp-c-divider);
}

tr:nth-child(2n) {
  background-color: var(--vp-c-bg-soft);
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--vp-c-divider);
}

th {
  font-weight: 600;
  background-color: var(--vp-c-bg-soft);
}

/* 代码行样式 */
div[class*="language-"] .highlight-lines .highlighted {
  background-color: rgba(98, 106, 239, 0.1);
}

.dark div[class*="language-"] .highlight-lines .highlighted {
  background-color: rgba(98, 106, 239, 0.2);
}

/* 代码块顶部语言标识 */
div[class*="language-"]::before {
  background-color: var(--vp-c-brand);
  border-radius: 4px;
  color: white;
  font-size: 12px;
}

/* 定制API表格 */
.api-table th {
  min-width: 120px;
}

.api-table th:first-child {
  min-width: 160px;
}

.api-table td > code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 13px;
  background-color: var(--vp-code-bg-color);
  border-radius: 3px;
  padding: 2px 4px;
}

/* 按钮组件文档样式 */
.button-row {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 首页特性样式 */
.VPFeature {
  position: relative;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border-radius: 12px;
}

.VPFeature:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.VPFeature .icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  width: 48px;
  height: 48px;
  font-size: 24px;
  border-radius: 8px;
  background-color: var(--vp-c-bg-soft);
  transition: background-color 0.25s;
}
